package com.rgs.oauthresource2.demos.web;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author RenGaoshuai
 * @date 2024/4/10 10:33
 * @description
 */
@RestController
public class HelloController {


    @GetMapping("/hello")
    public String hello() {
        return "Hello";
    }

    @PreAuthorize("hasRole('ROLE_admin')")
    @GetMapping("/admin")
    public String admin() {
        return "admin";
    }
}
